package store.lunangangster.engine.impl.entity;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class HistoryEntityImpl extends EntityImpl implements HistoryEntity {

  protected String processDefinitionId;
  protected String processDefinitionKey;
  protected String processInstanceId;
  protected String processInstanceName;
  protected String parentScopeId;
  protected String parentScopeName;
  protected String modelType;
  protected String modelId;
  protected String modelName;
  protected Object authentication;
  protected String notes;
  protected Date time;

  @Override
  public String getProcessDefinitionId() {
    return processDefinitionId;
  }

  @Override
  public String getProcessDefinitionKey() {
    return processDefinitionKey;
  }

  @Override
  public String getProcessInstanceId() {
    return processInstanceId;
  }

  @Override
  public String getProcessInstanceName() {
    return processInstanceName;
  }

  @Override
  public String getParentScopeId() {
    return parentScopeId;
  }

  @Override
  public String getParentScopeName() {
    return parentScopeName;
  }

  @Override
  public String getModelType() {
    return modelType;
  }

  @Override
  public String getModelId() {
    return modelId;
  }

  @Override
  public String getModelName() {
    return modelName;
  }

  @Override
  public String getAuthentication() {
    return authentication.toString();
  }

  @Override
  public String getNotes() {
    return notes;
  }

  @Override
  public Date getTime() {
    return time;
  }

  @Override
  public void setProcessDefinitionId(String processDefinitionId) {
    this.processDefinitionId = processDefinitionId;
  }

  @Override
  public void setProcessDefinitionKey(String processDefinitionName) {
    this.processDefinitionKey = processDefinitionName;
  }

  @Override
  public void setProcessInstanceId(String processInstanceId) {
    this.processInstanceId = processInstanceId;
  }

  @Override
  public void setProcessInstanceName(String processInstanceName) {
    this.processInstanceName = processInstanceName;
  }

  @Override
  public void setParentScopeId(String parentScopeId) {
    this.parentScopeId = parentScopeId;
  }

  @Override
  public void setParentScopeName(String parentScopeName) {
    this.parentScopeName = parentScopeName;
  }

  @Override
  public void setModelType(String modelType) {
    this.modelType = modelType;
  }

  @Override
  public void setModelId(String modelId) {
    this.modelId = modelId;
  }

  @Override
  public void setModelName(String modelName) {
    this.modelName = modelName;
  }

  @Override
  public void setAuthentication(Object authentication) {
    this.authentication = authentication;
  }

  @Override
  public void setNotes(String notes) {
    this.notes = notes;
  }

  @Override
  public void setTime(Date time) {
    this.time = time;
  }

  @Override
  public Object getPersistState() {
    Map<String, Object> persistState = new HashMap<>();

    persistState.put("processDefinitionId", processDefinitionId);
    persistState.put("processDefinitionName", processDefinitionKey);
    persistState.put("processInstanceId", processInstanceId);
    persistState.put("processInstanceName", processInstanceName);
    persistState.put("modelId", modelId);
    persistState.put("modelName", modelName);
    persistState.put("authentication", authentication);
    persistState.put("time", time);

    return persistState;
  }
}
